<?php

class Cookies {
	
	public static function isExists($name) {
		return isset($_COOKIE[$name]);
	}
	public static function get($name) {
		return isset($_COOKIE[$name]) ? $_COOKIE[$name] : '';
	}
	
	public static function set($name, $value, $timeInDays = 0, $path = '/') {
		setcookie($name, $value, time() + $timeInDays * 86400, $path);
		$_COOKIE[$name] = $value;
		return $value;
	}
}
